//
//  SelfSizeTool.m
//  10-自适应cell
//
//  Created by mafeng on 16/7/27.
//  Copyright © 2016年 mafeng. All rights reserved.
//

#import "SelfSizeTool.h"

@implementation SelfSizeTool
+ (CGFloat)selfSizeHeightWithString:(NSString *)string
                              width:(CGFloat)width
                               font:(UIFont *)font {
    CGRect rect = [string boundingRectWithSize:CGSizeMake(width, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName: font} context:nil];
    return rect.size.height;
    
}

@end
